package com.easy.dfc.service;

import com.easy.dfc.mapper.ProductReplyMapper;
import com.easy.dfc.mapper.ProductReplyImgsMapper;
import com.easy.dfc.mapper.SellerReplyForProductReplyMapper;
import com.easy.dfc.entity.ProductReply;
import com.easy.dfc.entity.ProductReplyImgs;
import com.easy.dfc.entity.SellerReplyForProductReply;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ProductReplyService {

    @Resource
    private ProductReplyMapper productReplyMapper;

    @Resource
    private ProductReplyImgsMapper productReplyImgsMapper;

    @Resource
    private SellerReplyForProductReplyMapper sellerReplyForProductReplyMapper;

    public int insertSelective(ProductReply productReply) {
        return productReplyMapper.insertSelective(productReply);
    }

    public int insertList(List<ProductReplyImgs> list) {
        return productReplyImgsMapper.insertList(list);
    }

    public float selectAvg(String productId) {
        return productReplyMapper.selectAvg(productId);
    }

    public int insertSelective(SellerReplyForProductReply sellerReplyForProductReply) {
        return sellerReplyForProductReplyMapper.insertSelective(sellerReplyForProductReply);
    }

    public List<ProductReply> selectByProductId(String productId, int start) {
        return productReplyMapper.selectByProductId(productId, start);
    }

    public List<ProductReplyImgs> selectByProductReplyId(int productReplyId) {
        return productReplyImgsMapper.selectByProductReplyId(productReplyId);
    }
}
